/***************************************
Replication Code for "The Effects of Certain and Uncertain Incentives on Effort and Knowledge Accuracy"
****************************************/

clear
pause on
set more off
log on
use "jeps.dta"


/***************************************
Table 1. Descriptive Statistics of Pre-treatment Political Information, by Treatment
****************************************/

/* T-tests for P-Values in Table 1. */

ttest k_correct if treatment ==0 | treatment ==1, by(treatment_text)
ttest k_correct if treatment ==0 | treatment ==2, by(treatment_text)
ttest k_correct if treatment ==0 | treatment ==3, by(treatment_text)

/* Pre-treatment Political Information Questions, By Treatment Group */

ssc install estout, replace

estpost tabstat k_correct, by(treatment) stat(count mean sd min max) columns(stat) listwise
esttab using "table1.tex", cells("count mean(fmt(%4.3f)) sd(fmt(%4.3f)) min max") replace title({Descriptive Statistics of Pre-treatment Information Accuracy, by Treatment.}\label{tab1})


/***************************************
Figure 2. Determinants of Effort
****************************************/

ssc install coefplot, replace

reg minutes i.treatment, r
coefplot, drop(_cons) xline(0, lpattern(dash) lcolor(black)) graphregion(fcolor(white)) lcolor(black) msize(small) graphregion(color(white)) mcolor(black) ciopts(lcolor(black)) xlabel(-2(1)2) xscale(range(-2(1)2)) subtitle("Time Spent on Survey (minutes)", margin(small))


/***************************************
Table 3. Descriptive Statistics of Predictive Accuracy, by Treatment.
****************************************/

/* T-tests for P-Values in Table 3. */

ttest p_correct if treatment ==0 | treatment ==1, by(treatment_text)
ttest p_correct if treatment ==0 | treatment ==2, by(treatment_text)
ttest p_correct if treatment ==0 | treatment ==3, by(treatment_text)

/* Pre-treatment Political Information Questions, By Treatment Group */

estpost tabstat p_correct, by(treatment) stat(count mean sd min max) columns(stat) listwise
esttab using "table3.tex", cells("count mean(fmt(%4.3f)) sd(fmt(%4.3f)) min max") replace title({Descriptive Statistics of Predictive Accuracy, by Treatment.}\label{tab1})


/***************************************
Figure 3. Determinants of Knowledge Accuracy
****************************************/

reg p_correct i.treatment, r
coefplot, drop(_cons) xline(0, lpattern(dash) lcolor(black)) graphregion(fcolor(white)) lcolor(black) msize(small) graphregion(color(white)) mcolor(black) ciopts(lcolor(black)) xlabel(-1(0.5)1) xscale(range(-1(0.5)1)) subtitle("Determinants of Knowledge Accuracy", margin(small))


/***************************************
Table 4. Direct Treatment Effects and Mediation Effects of Incentives on Knowledge Accuracy
****************************************/

ssc install mediation, replace
ssc install moremata, replace


medeff (regress minutes bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct bonus_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(bonus_treatment) mediate(minutes) sims(1000)
medeff (regress minutes random_bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct random_bonus_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(random_bonus_treatment) mediate(minutes) sims(1000)
medeff (regress minutes lottery_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct lottery_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(lottery_treatment) mediate(minutes) sims(1000)



/***********************************************************
*** SUPPLEMENTARY MATERIALS ***
***********************************************************/

/***************************************
Table A1. Descriptive Statistics
****************************************/

estpost summarize p_correct k_correct minutes democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption sq_total rel_attendance age white black hisp
esttab using "tableA1.tex", cells("count mean sd min max") noobs replace title({Descriptive Statistics.}\label{tab1})


/***************************************
Table A2. Descriptive Statistics of Correct Individual Knowledge Questions
****************************************/

estpost summarize p1_correct p2_correct p3_correct p4_correct p5_correct 
esttab using "tableA2.tex", cells("count mean sd min max") noobs replace title({Descriptive Statistics of Individual Political Prediction Questions.}\label{tab1})


/*****************************************************
Table A3. Determinants of Cognitive Effort as Measured by Time Spent (Minutes)
******************************************************/

eststo clear

/* Column 1 */

reg minutes i.treatment, r
estimates store c1, title(column 1)

/* Column 2 */

reg minutes i.treatment democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */

reg minutes i.treatment democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA3.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Information Search as Measured by Time Spent (Minutes).}\label{tab1})


/*****************************************************
Table A4. Determinants of Knowledge Accuracy
******************************************************/

eststo clear

/* Column 1 */

reg p_correct i.treatment, r
estimates store c1, title(column 1)

/* Column 2 */

reg p_correct i.treatment k_correct democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */
reg p_correct i.treatment k_correct democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA4.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Knowledge Accuracy.}\label{tab1})


/*****************************************************
Table A5. Determinants of Knowledge Accuracy, including Screening Questions
******************************************************/

eststo clear

/* Column 1 */

reg p_correct i.treatment sq_total, r
estimates store c1, title(column 1)

/* Column 2 */

reg p_correct i.treatment k_correct sq_total democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */
reg p_correct i.treatment k_correct sq_total democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA5.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Correct Predictions, including Screening Questions.}\label{tab1})


/*****************************************************
Table A6. Determinants of Knowledge Accuracy, Pooled Across Treatments
******************************************************/

eststo clear

/* Column 1 */

reg p_correct treatment_group, r
estimates store c1, title(column 1)

/* Column 2 */

reg p_correct treatment_group k_correct democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */
reg p_correct treatment_group k_correct democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA6.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Correct Predictions, Pooled Across Treatments.}\label{tab1})


/*****************************************************
Table A7. The Effects of Baseline Knowledge on Knowledge Accuracy in Control Group
******************************************************/

eststo clear

/* Column 1 */

reg p_correct k_correct if treatment == 0, r
estimates store c1, title(column 1)

/* Column 2 */

reg p_correct k_correct democrat republican ideology moderate_3 dem_agreement rep_agreement if treatment == 0, r
estimates store c2, title(column 2)

/* Column 3 */
reg p_correct k_correct democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp if treatment == 0, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA7.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({The Effects of Knowledge on Correct Predictions in Control Group.}\label{tab1})


/*****************************************************
Table A8. Determinants of Correct Individual Knowledge Questions (Logit)
******************************************************/

eststo clear

/* Column 1 */

logit p1_correct i.treatment, r
estimates store c1, title(column 1)

/* Column 2 */

logit p2_correct i.treatment, r
estimates store c2, title(column 2)

/* Column 3 */

logit p3_correct i.treatment, r
estimates store c3, title(column 3)

/* Column 4 */

logit p4_correct i.treatment, r
estimates store c4, title(column 4)

/* Column 5 */

logit p5_correct i.treatment, r
estimates store c5, title(column 5)

/*Building the Figure*/
esttab c1 c2 c3 c4 c5 using "tableA8.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) pr2 title({Determinants of Correct Individual Predictions (Logit).}\label{tab1})


/*****************************************************
Table A9. Randomization Check: F-test of Joint Orthogonality
******************************************************/

ssc install orth_out, replace

orth_out democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp using "tableA9.tex", by(treatment) se test latex replace


/*****************************************************
Table A10. Randomization Check: F-test of Joint Orthogonality
******************************************************/

orth_out democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp using "tableA10.tex", by(treatment) test pcompare count latex replace


/*****************************************************
Table A11. Direct Treatment Effects and Mediation Effects of Incentives on Knowledge Accuracy
******************************************************/

medeff (regress minutes bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct bonus_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(bonus_treatment) mediate(minutes) sims(1000)
medeff (regress minutes random_bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct random_bonus_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(random_bonus_treatment) mediate(minutes) sims(1000)
medeff (regress minutes lottery_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct lottery_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(lottery_treatment) mediate(minutes) sims(1000)


/*****************************************************
Figure A2. Average Causal Mediation Effect of the Bonus Treatment on Knowledge Accuracy as a Function Degree of Violation of Sequential Ignorability Assumption.
******************************************************/

medsens (regress minutes bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct bonus_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(bonus_treatment) mediate(minutes) sims(1000)
twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) graphregion(color(white)) mcolor(black) ytitle("ACME") xtitle("Sensitivity parameter: {&rho}") legend(off) title("ACME({&rho})")


/*****************************************************
Figure A3. Average Causal Mediation Effect of the Random Bonus Treatment on Knowledge Accuracy as a Function Degree of Violation of Sequential Ignorability Assumption.
******************************************************/

medsens (regress minutes random_bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct random_bonus_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(random_bonus_treatment) mediate(minutes) sims(1000)
twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) graphregion(color(white)) mcolor(black) ytitle("ACME") xtitle("Sensitivity parameter: {&rho}") legend(off) title("ACME({&rho})")


/*****************************************************
Figure A4. Average Causal Mediation Effect of the Lottery Treatment on Knowledge Accuracy as a Function Degree of Violation of Sequential Ignorability Assumption.
******************************************************/

medsens (regress minutes lottery_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct lottery_treatment minutes k_correct education age income politicalinterest newsconsumption vote), treat(lottery_treatment) mediate(minutes) sims(1000)
twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) graphregion(color(white)) mcolor(black) ytitle("ACME") xtitle("Sensitivity parameter: {&rho}") legend(off) title("ACME({&rho})")


/*****************************************************
Table A12. Direct Treatment Effects and Mediation Effects of Incentives on Knowledge Accuracy, with Information Search (self-report) as mediating variable
******************************************************/

medeff (regress is_total bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct bonus_treatment is_total k_correct education age income politicalinterest newsconsumption vote), treat(bonus_treatment) mediate(is_total) sims(1000)
medeff (regress is_total random_bonus_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct random_bonus_treatment is_total k_correct education age income politicalinterest newsconsumption vote), treat(random_bonus_treatment) mediate(is_total) sims(1000)
medeff (regress is_total lottery_treatment k_correct education age income politicalinterest newsconsumption vote) (regress p_correct lottery_treatment is_total k_correct education age income politicalinterest newsconsumption vote), treat(lottery_treatment) mediate(is_total) sims(1000)

save "jeps.dta", replace




/***************************************
PILOT STUDY
****************************************/
clear
pause on
set more off
use "pilot.dta"

/***************************************
Table A15. Descriptive Statistics
****************************************/

estpost summarize p_correct minutes democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption sq_total rel_attendance age white black hisp
esttab using "tableA15.tex", cells("count mean sd min max") noobs replace title({Descriptive Statistics.}\label{tab1})


/***************************************
Table A16. Descriptive Statistics of Correct Individual Prediction Questions
****************************************/

estpost summarize p1_correct p2_correct p3_correct p4_correct p5_correct p6_correct p7_correct p8_correct
esttab using "tableA16.tex", cells("count mean sd min max") noobs replace title({Descriptive Statistics of Individual Political Prediction Questions.}\label{tab1})



/*****************************************************
Table A17. Determinants of Cognitive Effort as Measured by Time Spent (Minutes)
******************************************************/

eststo clear

/* Column 1 */

reg minutes i.treatment, r
estimates store c1, title(column 1)

/* Column 2 */

reg minutes i.treatment democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */

reg minutes i.treatment democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA17.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Information Search as Measured by Time Spent (Minutes).}\label{tab1})


/*****************************************************
Table A18. Determinants of Political Predictions
******************************************************/

eststo clear

/* Column 1 */

reg p_correct i.treatment, r
estimates store c1, title(column 1)

/* Column 2 */

reg p_correct i.treatment democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */
reg p_correct i.treatment democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA18.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Political Predictions.}\label{tab1})


/*****************************************************
Table A19. Determinants of Knowledge Accuracy, including Screening Questions
******************************************************/

eststo clear

/* Column 1 */

reg p_correct i.treatment sq_total, r
estimates store c1, title(column 1)

/* Column 2 */

reg p_correct i.treatment sq_total democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */
reg p_correct i.treatment sq_total democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA19.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Correct Predictions, including Screening Questions.}\label{tab1})


/*****************************************************
Table A20. Determinants of Knowledge Accuracy, Pooled Across Treatments
******************************************************/

eststo clear

/* Column 1 */

reg p_correct treatment_group, r
estimates store c1, title(column 1)

/* Column 2 */

reg p_correct treatment_group democrat republican ideology moderate_3 dem_agreement rep_agreement, r
estimates store c2, title(column 2)

/* Column 3 */
reg p_correct treatment_group democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp, r
estimates store c3, title(column 3)

/*Building the Table*/
esttab c1 c2 c3 using "tableA20.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) r2 title({Determinants of Correct Predictions, Pooled Across Treatments.}\label{tab1})


/*****************************************************
Table A21. Determinants of Correct Individual Predictions (Logit)
******************************************************/

eststo clear

/* Column 1 */

logit p1_correct i.treatment, r
estimates store c1, title(column 1)

/* Column 2 */

logit p2_correct i.treatment, r
estimates store c2, title(column 2)

/* Column 3 */

logit p3_correct i.treatment, r
estimates store c3, title(column 3)

/* Column 4 */

logit p4_correct i.treatment, r
estimates store c4, title(column 4)

/* Column 5 */

logit p5_correct i.treatment, r
estimates store c5, title(column 5)

/* Column 6 */

logit p6_correct i.treatment, r
estimates store c6, title(column 6)

/* Column 7 */

logit p7_correct i.treatment, r
estimates store c7, title(column 7)

/* Column 8 */

logit p8_correct i.treatment, r
estimates store c8, title(column 8)


/*Building the Figure*/
esttab c1 c2 c3 c4 c5 c6 c7 c8 using "tableA21.tex", b(3) replace unstack nobaselevels label nogap se star (+ 0.1 * 0.05 ** 0.01 *** 0.001) pr2 title({Determinants of Correct Individual Predictions (Logit).}\label{tab1})


/*****************************************************
Table A22. Randomization Check: F-test of Joint Orthogonality
******************************************************/

orth_out democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp using "tableA22.tex", by(treatment) se test latex replace


/*****************************************************
Table A23. Randomization Check: F-test of Joint Orthogonality
******************************************************/

orth_out democrat republican ideology moderate_3 dem_agreement rep_agreement education income male politicalinterest newsconsumption rel_attendance age white black hisp using "tableA23.tex", by(treatment) test pcompare count latex replace


/*****************************************************
Table A24. Direct Treatment Effects and Mediation Effects of Incentives on the Number of Correct Answers for Prediction Questions
******************************************************/

medeff (regress minutes bonus_treatment education age income politicalinterest newsconsumption vote) (regress p_correct bonus_treatment minutes education age income politicalinterest newsconsumption vote), treat(bonus_treatment) mediate(minutes) sims(1000)
medeff (regress minutes random_bonus_treatment education age income politicalinterest newsconsumption vote) (regress p_correct random_bonus_treatment minutes education age income politicalinterest newsconsumption vote), treat(random_bonus_treatment) mediate(minutes) sims(1000)
medeff (regress minutes lottery_treatment education age income politicalinterest newsconsumption vote) (regress p_correct lottery_treatment minutes education age income politicalinterest newsconsumption vote), treat(lottery_treatment) mediate(minutes) sims(1000)


/*****************************************************
Figure A18. Average Causal Mediation Effect of the Bonus Treatment on the Number of Correct Predictions as a Function Degree of Violation of Sequential Ignorability Assumption.
******************************************************/

medsens (regress minutes bonus_treatment education age income politicalinterest newsconsumption vote) (regress p_correct bonus_treatment minutes education age income politicalinterest newsconsumption vote), treat(bonus_treatment) mediate(minutes) sims(1000)
twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) graphregion(color(white)) mcolor(black) ytitle("ACME") xtitle("Sensitivity parameter: {&rho}") legend(off) title("ACME({&rho})")


/*****************************************************
Figure A19. Average Causal Mediation Effect of the Random Bonus Treatment on the Number of Correct Predictions as a Function Degree of Violation of Sequential Ignorability Assumption.
******************************************************/

medsens (regress minutes random_bonus_treatment education age income politicalinterest newsconsumption vote) (regress p_correct random_bonus_treatment minutes education age income politicalinterest newsconsumption vote), treat(random_bonus_treatment) mediate(minutes) sims(1000)
twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) graphregion(color(white)) mcolor(black) ytitle("ACME") xtitle("Sensitivity parameter: {&rho}") legend(off) title("ACME({&rho})")


/*****************************************************
Figure A20. Average Causal Mediation Effect of the Lottery Treatment on the Number of Correct Predictions as a Function Degree of Violation of Sequential Ignorability Assumption.
******************************************************/

medsens (regress minutes lottery_treatment education age income politicalinterest newsconsumption vote) (regress p_correct lottery_treatment minutes education age income politicalinterest newsconsumption vote), treat(lottery_treatment) mediate(minutes) sims(1000)
twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) graphregion(color(white)) mcolor(black) ytitle("ACME") xtitle("Sensitivity parameter: {&rho}") legend(off) title("ACME({&rho})")


save "pilot.dta", replace

log close
